﻿
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ./{{cookiecutter.project_name}} .
WORKDIR "/src/{{cookiecutter.project_name}}"
RUN dotnet build "{{cookiecutter.project_name}}.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "{{cookiecutter.project_name}}.csproj" -c Release -o /app/publish

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
COPY --from=publish /app/publish .
EXPOSE 80
ENV TZ=Asia/Shanghai

ENTRYPOINT ["dotnet", "{{cookiecutter.project_name}}.dll"]